<?php if (!defined('THINK_PATH')) exit();?><style>
    .daterangepicker.dropdown-menu, .select2-container--open {
        z-index: 99999999;
    }
    .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
        height:30px;
    }
    .layui-layer-shade  {
        left:inherit;
        top:50px;
        position:absolute;
    }
</style>
<div class="row" id="myapp">
    <pop-agent-commission-set-component></pop-agent-commission-set-component>
    <pop-tree-organization-component></pop-tree-organization-component>

    <div class="col-xs-12">
        <div class="box box-danger">
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th style="width:35px;">#</th><th><?php echo C("AGENTCONFIG")[$level]['name'];?>名称</th><th>手机号码</th><th>所属运营中心</th><th>所属会员单位</th><th>所属微圈</th>
                        <th>手续费收益</th><th>用户状态</th><th>审核状态</th><th style="width:230px;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(index, item) in list">
                        <td>{{index+1}}</td><td>{{item.name}}</td><td>{{item.mobile_phone}}</td><td>{{item.operation_center}}</td><td>{{item.member_unit}}</td><td>{{item.micro_ring}}</td>
                        <td>{{item.balance | currency ''}}</td>
                        <td>
                            <span v-if="item.state==1" style="cursor:pointer;margin-right:3px;" class="badge bg-green" @click="changeState(item.id, 2);">正常</span>
                            <span v-if="item.state==2" style="cursor:pointer;margin-right:3px;" class="badge bg-danger" @click="changeState(item.id, 1);">停用</span>
                        </td>
                        <td>
                            <span v-if="item.audit_state == 1" style="color:#00a65a;">审核通过</span>
                            <span v-if="item.audit_state == 2" style="color:#dd4b39">待审核</span>
                            <span v-if="item.audit_state == 3" style="color:#808080;">驳回</span>
                        </td>
                        <td v-if="item.audit_state == 1">
                            <span class="label bg-purple" style="cursor:pointer;margin-right:3px;" @click="openAgentCommissionSetWin(item);" v-if="setting[1]===1">返佣</span>
                            <span class="label label-primary" style="cursor:pointer;margin-right:3px;" @click="sel_belong(item);">经纪人归属</span>
                            <span class="label label-primary" style="cursor:pointer;margin-right:3px;display: none;" @click="gotoInfoPage(item.id);">详情</span>
                        </td>
                        <td v-if="item.audit_state == 2">
                            <span class="label btn-success" style="cursor:pointer;margin-right:3px;" @click="changeAuditState(item.id, 1);">通过</span>
                            <span class="label btn-danger" style="cursor:pointer;margin-right:3px;" @click="changeAuditState(item.id, 3);">驳回</span>
                        </td>
                        <td v-if="item.audit_state == 3"></td>
                    </tr>
                    <tr>
                        <td>#</td><td>汇总：</td><td></td><td></td><td></td><td></td>
                        <td style="background-color:#ff4053;color:#ffffff;">{{sum_balance}}&nbsp;元</td><td></td><td></td><td></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!-- /.box-body -->
            <div class="box-footer clearfix">
                <div id="info_data" class="col-sm-5" style="top:5px;">
                    当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条
                </div>
                <div class="col-sm-7">
                    <ul id="paging" class="pagination pagination-sm no-margin pull-right">
                        <li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>
                        <li><a href="javascript:void(0);" v-bind:class="{'page_active':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>
                        <li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>
                    </ul>
                </div>
            </div>
            <div class="overlay hidden">
                <i class="fa fa-refresh fa-spin"></i>
            </div>
        </div>
        <!-- /.box -->
    </div>
</div>

<div class="layui-layer-shade" id="layui-layer-shade" times="1" style="z-index:19891014; background-color:#ffffff; opacity:1; filter:alpha(opacity=1);"></div>
<div class="layui-layer layui-layer-loading  layer-anim" id="layui_layer" type="loading" times="1" showtime="0" contype="string" style="z-index: 19891015;"><div id="" class="layui-layer-content layui-layer-loading0"></div><span class="layui-layer-setwin"></span></div>

<script>
    var root = 'admin';
    var level = <?php echo ($level); ?>;
    layuiLayerLoad();
</script>
<script src="./WebApp/Admin/View/Public/self/js/agent/components.js"></script>
<script src="./WebApp/Admin/View/Public/self/js/agent/vue.js"></script>